package com.dearbinge.data.redis;


import java.util.Scanner;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.support.ClassPathXmlApplicationContext;

//@SpringBootApplication(scanBasePackages="org.dearbinge.data.redis")
//@ImportResource({"classpath:dubbo-spring-mybatis.xml"})
//@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
public class RedisApp
{
	public static void main(String[] args) {
//		 SpringApplication.run(RedisApp.class, args);
//		 System.err.println("提供者启动成功");

		ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("dubbo-spring-mybatis.xml");
		ctx.refresh();
		ctx.start();
		Scanner scan = new Scanner(System.in);
		System.out.println("service started");
		Boolean wait = true;
		while (wait) {
			String result = scan.nextLine();
			while (!result.equals("stop")) {
				System.out.println("service continue");
				result = scan.nextLine();
			}
			System.out.println("are you sure stop services?");
			result = scan.nextLine();
			if (!result.equals("y")) {
				System.out.println("service continue");
				continue;
			}
			wait = false;
		}
		System.out.println("service end");
		ctx.close();
		scan.close();
	}
}
